import request from "../request.js"

function doLogin(data) {
	return request({
		url: "/lejuClient/login/doLogin",
		method: "POST",
		data
	})
}

function getMemberInfo() {
	return request({
		url: "/lejuClient/login/getMemberInfo",
	})
}

function updateMemberInfo(data) {
	return request({
		url: "/lejuClient/member/updateMemberInfo",
		method: "POST",
		data
	})
}

function register(data) {
	return request({
		url: "/lejuClient/member/register",
		method: "POST",
		data
	})
}

function findAllAddress() {
	return request({
		url: "/lejuClient/address/findAllAddress",
	})
}

function addAddressInfo(data) {
	return request({
		url: "/lejuClient/address/addAddressInfo",
		method: "POST",
		data
	})
}

function updateAddressInfo(data) {
	return request({
		url: "/lejuClient/address/updateAddressInfo",
		method: "POST",
		data
	})
}

function findProductList(start, limit, data) {
	return request({
		url: `/lejuClient/product/findProductList/{start}/{limit}`,
		data: data,
		method: "POST"
	})
}

function delAddressInfo(addressId) {
	return request({
		url: `/lejuClient/address/delAddressInfo/${addressId}`,
		method: "DELETE",
	})
}

function findAllCartItem() {
	return request({
		url: "/lejuClient/cart/findAllCartItem",
	})
}

function findAllOrders() {
	return request({
		url: "/lejuClient/order/findAllOrders",
	})
}
function orderReturnApplys() {
	return request({
		url: "/lejuClient/orderReturn/orderReturnApplys",
	})
}

function cancelOrder(orderId) {
	return request({
		
		url:`/lejuClient/order/cancelOrder/${orderId}`,
		method: "POST"
	})
}

function receiveDone(data) {
	return request({
		
		url:`/lejuClient/order/receiveDone`,
		method: "POST",
		data
	})
}

function deleteOrder(orderId) {
	return request({
		url:`/lejuClient/order/deleteOrder/${orderId}`,
		method: "DELETE",
		
	})
}

function getPreOrderById(orderId) {
	return request({
		url:`/lejuClient/order/getPreOrderById/${orderId}`,
	})
}

function getCompanyAddrss() {
	return request({
		url:`/lejuClient/orderReturn/getCompanyAddrss`,
	})
}

function addOrderReturnApply(data) {
	return request({
		
		url:`/lejuClient/orderReturn/addOrderReturnApply`,
		method: "POST",
		data
	})
}
function orderReturn(id) {
	return request({
		url:`/lejuClient/orderReturn/${id}`,
	})
}

function resetPassword(username) {
	return request({
		url:`/lejuClient/member/resetPassword/${username}`,
		method: "POST",
	})
}


export {
	doLogin,
	getMemberInfo,
	updateMemberInfo,
	register,
	findAllAddress,
	addAddressInfo,
	updateAddressInfo,
	delAddressInfo,
	findAllCartItem,
	findAllOrders,
	orderReturnApplys,
	cancelOrder,
	receiveDone,
	deleteOrder,
	getPreOrderById,
	getCompanyAddrss,
	addOrderReturnApply,
	orderReturn,
	resetPassword
}
